<include file="../Public/manage_top" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-admin-box.js" ></script>
<div class="contents BBS">
  <div class="bbs_left">
 	<include file="../Public/manage_left" />
  </div>
   <div class="rightBox" style="margin-left:150px;_margin-left:0px;">
	<div onclick="changeIframe()" class="sideBarToggle"><img src="../Public/images/clearleft.gif"  /></div>
  <div class="bbs_main">
    <div class="top_address">
<span class="edi_adder">
			{$_topnav}
	  </span></div>
      <div class="tit_h3">{:L('base_nav_thread')}</div>
	 <form autocomplete="off">
    <div class="list_box">
      <ul class="tab">
     	<li <eq name="type" value="index">class="on"</eq> ><span><a  href="{:U('bbs/Manage/index',array('type'=>'index','class'=>$board))}">{:L('base_board_thread')}</a></span></li>
        <li <eq name="type" value="recycle">class="on"</eq> ><span><a  href="{:U('bbs/Manage/index',array('type'=>'recycle','class'=>$board))}"></a></span></li>
      </ul>
      <p class="tab_b">
      	<span>
      		<a <eq name="tclass" value="0">class="on"</eq> href="{:U('bbs/Manage/index',array('class'=>$board,'type'=>$type))}">{:L('all')}</a>
		</span>
		<volist id="vo" name="tclasslist">
			<php>$classstyle = ($key==$tclass)?'class="on"':'';</php>
            <span>|</span>
			<span><a  {$classstyle} href="{:U('bbs/Manage/index',array('class'=>$board,'tclass'=>$key,'type'=>$type))}">{$vo}</a></span>
		</volist>
		</p>      
      <dl>
        <dt>
          <div style="width: 4%;" class="cl">{:L('operation')}</div>
          <div style="width: 63%;" class="cl">{:L('base_thread')}</div>
          <div style="width: 11%;" class="cl">{:L('thread_author')}/{:L('thread_addtime')}</div>
          <div style="width: 10%;" class="cc">{:L('thread_reply_count')}/{:L('thread_view_count')}</div>
          <div style="width: 11.5%;" class="cr">{:L('thread_new_reply')}/{:L('thread_new_replytime')}</div>
        </dt>
<volist id="vo" name="topic['data']">
        <dd class="det">
		  <div style="width:4%" class="cl">
		  	<eq name="type" value="index">
		  	 <input type="checkbox" class="answer_admin_check mt10" rel="0,2,3,4" dataId="{$vo.id}">
			<else />
			<input type="checkbox" class="answer_admin_check mt10" rel="1,2" dataId="{$vo.id}">
			</eq>
		  </div>        	
          <div style="width: 63%;" class="cl f14">
		  		<a class="mr10" href="{:U('bbs/Index/detail',array('id'=>$vo['id']))}" target="_blank">{$vo.title}</a><span class="f12">
				<eq name="vo['dist']" value="1"><span class="zd">&nbsp;</span></eq>
				<eq name="vo['top']" value="1"><span class="jh">&nbsp;</span></eq>
				<eq name="vo['lock']" value="1"><span class="suo">&nbsp;</span></eq>
				<eq name="vo['attach']" value="1"><span class="dow_icon" title="{:L('thread_attach')}">&nbsp;</span></eq>
				<eq name="tclass" value="0"><span class="f12">[ <neq name="vo['tclass']" value="0">{:$tclasslist[$vo['tclass']]}<else />{:L('edit_default_tclass')}</neq> ]</span></eq></span>
		  </div>
          <div style="width: 11%;" class="cl lh16"><cite class="author"><a href="{:U('space/View/index',array('uid'=>$vo['uid']))}">{$vo.uid|getUserName}</a></cite>
            <em>{$vo.cTime|friendLydate}</em></div>
          <div style="width: 10%;" class="cc">{$vo.viewcount} / <span class="cl04">{$vo.replycount}</span></div>
          <div style="width: 11.5%;" class="cr lh16"><cite class="author"><a href="{:U('space/View/index',array('uid'=>$vo['lastreuid']))}">{$vo.lastreuid|getUserName}</a></cite>
            <em>{$vo.rTime|friendLydate}</em>
		  </div>
          <div class="C"></div>
        </dd>
</volist>
      </dl>
    </div>
	</form>
   <div class="page mt5 alR mb20">{$topic['html']}</div>
  </div>
</div>
<div class="C"></div>
</div>

  <div id="topicadmin" style="display:none;"> 
  	<a href="javascript:void(0)" onclick="moveTorecycle()">{:L('thread_movetorecycle')}</a>
  	<a href="javascript:void(0)" onclick="revertTopic()">{:L('thread_reverttopic')}</a>
	<a href="javascript:void(0)" onclick="deleteTopic()">{:L('thread_deletetopic')}</a>
	<a href="javascript:void(0)" onclick="moveToCategory()">{:L('thread_movetocategory')}</a>
	<a href="javascript:void(0)" onclick="moveToTclass()">{:L('thread_movetotclass')}</a>
  </div>
  
  <script>
	var doadminurl = "{:U('bbs/Manage/doadmin',array('class'=>$board))}";
    $(function(){
	     $.fn.admin({
		     prefix:'topic_',
		     checkClass:'answer_admin_check',
		     hiddenId:'topicadmin',
			 lMinOffset:1,
			 position:'right',
			 type:false
	     });
    });	
	
	//移入回收站
	function moveTorecycle(){
		if(confirm('{:L("thread_movetorecycle_info")}')){
			$.post(doadminurl,{type:'moveTorecycle',id:$.fn.getData('topic_')},function(txt){
				window.location.reload()
			});
		}
	}
	
	//还原主题
	function revertTopic(){
		if(confirm('{:L("thread_reverttopic_info")}')){
			$.post(doadminurl,{type:'revertTopic',id:$.fn.getData('topic_')},function(txt){
				window.location.reload()
			});
		}
	}	
	
	
	//彻底删除
	function deleteTopic(){
		if(confirm('{:L("thread_deletetopic_info")}')){
			$.post(doadminurl,{type:'deleteTopic',id:$.fn.getData('topic_')},function(txt){
				window.location.reload()
			});
		}
	}
	
	//移动分类 
	function moveToCategory(){
		$.tbox.popup("{:U('bbs/Manage/movecategory',array('class'=>$board))}","{:L('thread_movetocategory_info')}");
	}
	
	//移动分类 
	function moveToTclass(){
		$.tbox.popup("{:U('bbs/Manage/movetclass',array('class'=>$board))}","{:L('thread_movetotclass_info')}");
	}	
</script>
<include file="__THEME__/footer" /> 